import {
    ADDRESS,
    SIGNATURE,
} from './constants';

// 定义一个状态
let initialState = {
    walletAddress: '',
    signature: 'test'
};

// 利用reducer将store和action串联起来
function reducer(state = initialState, action: { type: any; payload: any; }) {
    switch (action.type) {
        case ADDRESS:
            return { ...state, walletAddress: action.payload };
        case SIGNATURE:
            return { ...state, singature: action.payload }
        default:
            return state;
    }
}


export default reducer;